import { createApp } from "vue";
import App from "@/App.vue";
import router from "@/router";
import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "element-plus/dist/index.css";
import * as Icons from "@element-plus/icons-vue"; // 引入所有图标
import { create } from "naive-ui";
import MainLayout from "@/components/layout/MainLayout.vue";
import BlankLayout from "@/components/layout/BlankLayout.vue";
// 导入全局样式
import "@/styles/index.scss";
// 导入vant样式
import 'vant/lib/index.css'

// 创建naive-ui实例
const naive = create({
  // 可以在这里自定义主题
});

const app = createApp(App);

// 全局注册MainLayout
app.component("MainLayout", MainLayout);
app.component("BlankLayout", BlankLayout);

// 全局注册所有图标
for (const [key, component] of Object.entries(Icons)) {
  app.component(key, component);
}
app.use(router);
app.use(ElementPlus, {
  locale: zhCn,
});
app.use(naive);

app.mount("#app");
